close all;
clear all;
clc;

%define grid
Sx=1;  %physical size along x
Sy=1;  %physical size along y
Nx=20; %number of cells along x
Ny=20; %number of cells along x


% grid arrays
dx = Sx/Nx;
xa =[0:Nx-1]*dx;
xa = xa - mean(xa);

dy = Sy/Ny;
ya = [0:Ny-1]*dy;
ya = ya - mean(ya);


% create circule
y = 0.2 + 0.1*cos(4*pi*xa/Sx);

% fill half space
A=zeros(Nx, Ny);
for nx = 1:Nx
    ny = round((y(nx) + Sy/2)/dy);
    A(nx,1:ny)=1;
end
A'



